package com.ydm.fire_fighting_web.modules.index.mapper;


import com.ydm.fire_fighting_web.entity.index.BaseArea;
import com.ydm.fire_fighting_web.entity.index.Criteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AreaDao {
	@Select("SELECT DISTINCT\n" +
			"\t\tarea.base_areaid,area.name FROM base_area area where 1=1 and\n" +
			"\t\tarea.parentid='0'")
	// 查询省
	public List<BaseArea> findProvince();
	@Select("SELECT DISTINCT\n" +
			"\t\tarea.base_areaid,area.name FROM base_area area where 1=1 and\n" +
			"\t\tarea.parentid=#{condition.province}")
	// 查询市
	public List<BaseArea> findCity(Criteria paramCriteria);
	@Select("SELECT DISTINCT\n" +
			"\t\tarea.base_areaid,area.name FROM base_area area\n" +
			"\t\twhere 1=1 and\n" +
			"\t\tarea.parentid=#{condition.city}")
	// 查询县区
	public List<BaseArea> findCounty(Criteria paramCriteria);
}
